﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace HigLabo.Core
{
    public class JsonSerializer : Serializer
    {
        public JsonSerializer JavaScriptSerializer { get; set; }

        public JsonSerializer()
        {
            this.JavaScriptSerializer = new JsonSerializer();
        }
        public override String Serialize(Object obj)
        {
            if (obj == null) { return ""; }
            return this.JavaScriptSerializer.Serialize(obj);
        }
        public override T Deserialize<T>(String text)
        {
            return this.JavaScriptSerializer.Deserialize<T>(text);
        }
    }
}
